﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PJ.DBModel.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace PJ.DBModel.Mappings
{
    public class RoleauthorizeMap : IEntityTypeConfiguration<Roleauthorize>
    {
        public void Configure(EntityTypeBuilder<Roleauthorize> builder)
        {
            builder.HasKey(e => new { e.RoleId, e.ModuleId, e.ButtonId }).HasName("PK__roleauth__AAA20E5A419A02D8");

            builder.ToTable("roleauthorize");

            builder.HasComment("角色授权表");

            builder.Property(e => e.RoleId)
                .HasMaxLength(10)
                .IsFixedLength()
                .HasComment("角色主键");

            builder.Property(e => e.ModuleId)
                .HasMaxLength(10)
                .IsFixedLength()
                .HasComment("模块主键");

            builder.Property(e => e.ButtonId)
                .HasMaxLength(10)
                .IsFixedLength()
                .HasComment("按钮主键");
        }
    }
}
